package Day02;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        float w = sc.nextFloat();
        String b = sc.next();
        int ans = 0;
        if(b.equals("y")){
            ans += 5;
        }
        ans += 20;
        if(w > 1){
            ans += (w > (int)w ? (int)(w-1) + 1 : w-1);
        }
        System.out.println(ans);

    }

    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        if(n == 1){
            System.out.println(0);
            return;
        }
        int[] dp = new int[n + 1];

        for(int i = 2; i < n + 1; i++){
            dp[i] = Math.min(dp[i-1]+arr[i-1], dp[i-2]+arr[i-2]);
        }
        System.out.println(dp[n]);
    }

    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str1 = sc.next();
        String str2 = sc.next();
        String[] strs = new String[n];
        for(int i = 0; i < n; i++){
            strs[i] = sc.next();
        }
        int l = -1;
        int r = -1;
        if(str1.equals("null") || str2.equals("null")){
            System.out.println(-1);
            return;
        }
        int ans = n;
        for(int i = 0; i < n; i++){
            if(strs[i].equals(str1)){
                l = i;
                if(r != -1){
                    ans = Math.min(ans, Math.abs(l - r));
                }
            }

            if(strs[i].equals(str2)){
                r = i;
                if(l != -1){
                    ans = Math.min(ans, Math.abs(l - r));
                }
            }
        }
        if(l == -1 || r == -1){
            System.out.println(-1);
            return;
        }
        System.out.println(ans);
    }
}
